package com.jt.controller;

import com.jt.pojo.ItemCat;
import com.jt.pojo.ItemSort;
import com.jt.service.ItemSortService;
import com.jt.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/itemSort")
public class ItemSortController {
    @Autowired
    private ItemSortService itemSortService;

    @RequestMapping("/findItemSortList")
    public SysResult findItemSortList(@RequestBody ItemCat itemCat){
        List<ItemSort> itemSortList = itemSortService.findItemSortList(itemCat.getId());
        return SysResult.success(itemSortList);
    }
}
